﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;

using Infrastructure.Core.Common;
using SMG.Application.DTO.System;

namespace SMG.ServiceContract.System
{
    /// <summary>
    /// 用户服务接口
    /// </summary>
    [ServiceContract]
    public interface IUserService
    {
        /// <summary>
        /// 注册用户
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract]
        bool Register(UserDto userDto);
        /// <summary>
        /// 校验用户
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        [OperationContract]
        bool ValidateUser(String userName, String password);
        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract]
        bool UpdateUser(UserDto userDto);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        [OperationContract]
        bool DeleteUser(long userId);
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        [OperationContract]
        UserDto GetUser(long userId);
        /// <summary>
        /// 启用用户
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Boolean EnableUser(long userId);
        /// <summary>
        /// 禁用用户
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Boolean DisableUser(long userId);
        /// <summary>
        /// 查询所有用户列表
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        IEnumerable<UserDto> QueryAll();
        /// <summary>
        /// 分页查询用户信息
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        [OperationContract]
        PageResult<UserDto> QueryUserByPage(Int32 pageIndex, Int32 pageSize);

    }
}
